﻿using System;
using AutoPoco.Engine;

namespace Autopoco.Contrib.DataSources
{
    public class RandomDatetimeSource : DatasourceBase<DateTime>
    {
        private readonly Random _random = new Random(100);
        private readonly Random _randomSign = new Random(1000);
        
        public override DateTime Next(IGenerationSession session)
        {
            return
                DateTime.Now.Date.AddDays(_randomSign.NextDouble() > 0.5
                                              ? _random.Next(0, 100)
                                              : _random.Next(0, 100)*-1);
        }
    }
}